<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%String contextRoot = request.getContextPath();%>
<f:loadBundle basename="properties.messages" var="msg" />
<f:view>
<!doctype html>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <title>SISDEP : Sistema de Informaci<h:outputText value="#{msg.tilde_o}" />n de Espacio P<h:outputText value="#{msg.tilde_u}" />blico</title>
	<meta name="description" content="" />
	<meta name="author" content="" />		     
	<link rel="stylesheet" href="<%=contextRoot%>/css/validationEngine.jquery.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/template.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/normalize.css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/uniform.css"> <!-- estilos formularios -->
	<link rel="stylesheet" href="<%=contextRoot%>/css/cuerpo.css">	
	<link rel="stylesheet" href="<%=contextRoot%>/css/richCustom.css">	
</head>
<body>
<div id="marco"> <!--inicio contenedor --> 
<div class="arriba-cuerpo"></div> 
<div class="cuerpo">
<a href="<%=contextRoot%>/index.jsf"><img src="<%= contextRoot %>/images/logos.png" /></a>
<div class="clear"></div>
<!-- Menu y Usuario init() -->
	<%@ include file="include/menuUsuario.jsp" %>
<!-- Menu y Usuario end() -->
<div class="clear"></div>
<!-- Formulario --> 
<div id="buscador">
<h2>Gesti<h:outputText value="#{msg.tilde_o}" />n de Desmonte: <h:outputText value="#{empty operdesmonteretController.operdesmonteret.codigo ? 'NUEVO' : 'EDICION'}" /></h2>

<h:form id="manageOperDesmonteRetForm">

						<span class="left" style="margin-left:0px">
						<label>C<h:outputText value="#{msg.tilde_o}" />digo <span class="asterisco">*</span></label>
							<h:inputText id="codigo" size="9" disabled="#{!empty operdesmonteretController.operdesmonteret.id}" maxlength="9" styleClass="validate[required,custom[onlyLetterNumber]]"
										value="#{operdesmonteretController.operdesmonteret.codigo}" />
						</span>
 
						<span class="espacio-adicional left" style="margin-left:10%">
						<label>Fecha Registro <span class="asterisco">*</span></label>
							<h:inputText id="fechaRegistro" styleClass="validate[required,custom[date]] fechaRegistro" size="10" maxlength="10"
									value="#{operdesmonteretController.operdesmonteret.fechaRegistro}">
								<f:convertDateTime pattern="dd/MM/yyyy"/>
							</h:inputText>
						</span>

						<span class="left" style="margin-left:10%">
						<label>Hora <span class="asterisco">*</span> </label>
							<h:selectOneMenu id="hora" styleClass="validate[required]"
								value="#{operdesmonteretController.operdesmonteret.hora}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="06:00" itemValue="06:00"/>
                                <f:selectItem itemLabel="07:00" itemValue="07:00"/>
                                <f:selectItem itemLabel="08:00" itemValue="08:00"/>
                                <f:selectItem itemLabel="09:00" itemValue="09:00"/>
                                <f:selectItem itemLabel="10:00" itemValue="10:00"/>
                                <f:selectItem itemLabel="11:00" itemValue="11:00"/>
                                <f:selectItem itemLabel="12:00" itemValue="12:00"/>
                                <f:selectItem itemLabel="13:00" itemValue="13:00"/>
                                <f:selectItem itemLabel="14:00" itemValue="14:00"/>
                                <f:selectItem itemLabel="15:00" itemValue="15:00"/>
                                <f:selectItem itemLabel="16:00" itemValue="16:00"/>
                                <f:selectItem itemLabel="17:00" itemValue="17:00"/>
                                <f:selectItem itemLabel="18:00" itemValue="18:00"/>
                            </h:selectOneMenu>
						</span>
						
						<span class="left" style="margin-left:10%">
						<label>Tipo Desmonte <span class="asterisco">*</span> </label>
							<h:selectOneMenu id="idTipoDesmonte" styleClass="validate[required]" value="#{operdesmonteretController.operdesmonteret.idTipoDesmonteStr}">
								<f:selectItem itemLabel="Seleccione..." itemValue=""/>
								<f:selectItems value="#{masterListCache.dismantleType}"/>
							</h:selectOneMenu>
						</span>
						
				<div class="clear"></div>    <br/>
				
						<span class="left" style="margin-left:0px">
						<label>Nombre Infractor <span class="asterisco">*</span></label>
							<h:inputText id="nombreInfractor" size="40" maxlength="50" styleClass="validate[required,custom[onlyLetterSp]]"
										value="#{operdesmonteretController.operdesmonteret.nombreInfractor}" />
						</span>
    
						<span class="left" style="margin-left:10%">
						<label>Documento Infractor <span class="asterisco">*</span></label>
							<h:inputText id="documentoInfractor" size="20" maxlength="20" styleClass="validate[required,custom[onlyLetterNumber]]"
										value="#{operdesmonteretController.operdesmonteret.documentoInfractor}" />
						</span>
						 
						
						
				<div class="clear"></div><br/>
				
				<span class="left" style="margin-left:0px">
						<label>Tipo Infracci<h:outputText value="#{msg.tilde_o}" />n <span class="asterisco">*</span></label>
							<h:selectOneMenu id="idTipoInfraccion" styleClass="validate[required]" value="#{operdesmonteretController.operdesmonteret.idTipoInfraccionStr}">
								<f:selectItem itemLabel="Seleccione..." itemValue=""/>
								<f:selectItems value="#{masterListCache.infractionType}"/>
							</h:selectOneMenu>
						</span>
				  
						<span class="left" style="margin-left:10%">
						<label>N<h:outputText value="#{msg.tilde_u}" />mero Permiso (Dejar en blanco si no posee) </label>
							<h:inputText id="idPermisoDep" size="10" maxlength="9" styleClass="validate[custom[onlyLetterNumber]]"
										value="#{operdesmonteretController.operdesmonteret.idPermisoDep}" />
						</span>
						   
						  <div class="clear"></div><br/> 
						  
						  
						  <span class="left" style="margin-left:0px">
							<label>Direcci<h:outputText value="#{msg.tilde_o}" />n Retenci<h:outputText value="#{msg.tilde_o}" />n <span class="asterisco">*</span></label>
							<h:inputText id="direccionRetencion" size="60" maxlength="40" styleClass="validate[required]"
										value="#{operdesmonteretController.operdesmonteret.direccionRetencion}" />
								
							<a4j:commandButton id="checkAddressButton"
											 styleClass="botonsmall"
							                 type="submit" 
							                 value="Verificar..." ajaxSingle="true" 
							                 ondblclick="return false;" reRender="checkAddressPanel"
					                         action="#{operdesmonteretController.checkAddress}" >
					                         
					                         <a4j:actionparam name="addressParam" value="document.getElementById('manageOperDesmonteRetForm:direccionRetencion').value" 
					                                          assignTo="#{operdesmonteretController.operdesmonteret.direccionRetencion}" noEscape="true" />
							</a4j:commandButton>
						</span>
						<div class="clear" style="margin-left: 400px;"></div>
						
						<span class="left" style="margin-left:0px"><label>
						<a4j:outputPanel id="checkAddressPanel" layout="block" >
							<h:panelGrid columns="1" style="text-align: left;" styleClass="tablapaginacion" >
							<h:outputText value="Barrio: #{operdesmonteretController.operdesmonteret.codigoBarrio}-#{operdesmonteretController.operdesmonteret.barrio}" />
							<h:outputText value="Comuna: #{operdesmonteretController.operdesmonteret.codigoComuna}-#{operdesmonteretController.operdesmonteret.comuna}" />
	                        </h:panelGrid>
                        </a4j:outputPanel>
                        </label>			
						</span>
				<div class="clear"></div> 
						  
						<span class="left" style="margin-left:0px">
						<label>Lugar <span class="asterisco">*</span> </label>			
							<h:selectOneMenu id="lugar" styleClass="validate[required]"
								value="#{operdesmonteretController.operdesmonteret.lugar}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="Periferia" itemValue="PERIFIERIA"/>
                                <f:selectItem itemLabel="Centro" itemValue="CENTRO"/>
                            </h:selectOneMenu>
						</span>
						
	   
	   
						<span class="left" style="margin-left:10%">
						<label>Tipo Venta <span class="asterisco">*</span> </label>
							<h:selectOneMenu id="idTipoVenta" styleClass="validate[required]" value="#{operdesmonteretController.operdesmonteret.idTipoVentaStr}">
								<f:selectItem itemLabel="Seleccione..." itemValue=""/>
								<f:selectItems value="#{masterListCache.saleTypeList}"/>
							</h:selectOneMenu>
						</span>
						
						<span class="left" style="margin-left:10%">
						<label>Estado <span class="asterisco">*</span> </label>
							<h:selectOneMenu id="estado" styleClass="validate[required]"
								value="#{operdesmonteretController.operdesmonteret.estado}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="Nuevo" itemValue="NUEVO"/>
                                <f:selectItem itemLabel="Entregado" itemValue="ENTREGADO"/>
                                <f:selectItem itemLabel="Donado" itemValue="DONADO"/>
                                <f:selectItem itemLabel="Perecido" itemValue="PERECIDO"/>
                            </h:selectOneMenu>
						</span>
						
						<div class="clear"></div><br/> 

						
						<span class="left" style="margin-left:0px">
						<label>Nombre Responsable <span class="asterisco">*</span> </label>
							<h:inputText id="nombreResponsable" size="40" maxlength="50" styleClass="validate[custom[onlyLetterSp]]"
										value="#{operdesmonteretController.operdesmonteret.nombreResponsable}" />
						</span>
  
						<span class="left" style="margin-left:10%">
						<label>Documento Responsable <span class="asterisco">*</span> </label>
							<h:inputText id="documentoResponsable" size="20" maxlength="10" styleClass="validate[custom[onlyLetterNumber]]"
										value="#{operdesmonteretController.operdesmonteret.documentoResponsable}" />
						</span>
						
					<div class="clear"></div><br/>    
					
						<span class="left" style="margin-left:0px">
						<label>Nombre Encargado Bodega </label>
							<h:inputText id="nombreEncargadoBodega" size="40" maxlength="50" styleClass="validate[custom[onlyLetterSp]]"
										value="#{operdesmonteretController.operdesmonteret.nombreEncargadoBodega}" />
						</span>
    
						<span class="left" style="margin-left:10%">
						<label>Documento Encargado Bodega </label>
							<h:inputText id="documentoEncargadoBodega" size="20" maxlength="10" styleClass="validate[custom[onlyLetterNumber]]"
										value="#{operdesmonteretController.operdesmonteret.documentoEncargadoBodega}" />
						</span> 
					
					<div class="clear"></div><br/> 
						<span class="left" style="margin-left:5px">
						<label>Observaciones </label>
							<h:inputTextarea id="observaciones"
							style="width:300px !important; min-width:300px !important; max-width:300px !important; height:80px !important; min-height:80px !important; max-height:80px !important; "
							value="#{operdesmonteretController.operdesmonteret.observaciones}" />
						</span>
						
				<div class="clear"></div>    
		<div class="clear"></div>
		(<span class="asterisco"> * </span>) : Campo Obligatorio
		<div class="clear"></div>
		<span class="botones right">
		<h:commandButton id="createOperDesmonteRetButton"
						 styleClass="botonsmall"
             type="submit" 
             value="Guardar" 
             ondblclick="return false;" 
             action="#{operdesmonteretController.manage}" >
		</h:commandButton>
		</span>
</h:form>
</div>
<!-- Fin formulario --> 
				<div class="clear"></div><br/> 
				<div class="clear" style="width: 400px; margin-left: 0px;"></div>
				<div class="clear" style="margin-left: 350px;"></div>
				<span class="botones left" style="width: 223px; height: 15px; margin-left:25px; padding-top:5px; padding-bottom:5px; padding-left:20px; padding-right:20px; background-color: #006F73; color: white;">
				Informaci<h:outputText value="#{msg.tilde_o}" />n de Auditor<h:outputText value="#{msg.tilde_i}" />a
				</span>
				<div class="clear" style="margin-left: 350px;"></div>
				<div>
				<span class="left" >
				<span class="left" style="width: 110px; height: 15px; margin-left:25px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #EDEDED; border-top: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; color: #666666;">Usuario Creaci<h:outputText value="#{msg.tilde_o}" />n</span>
				<span class="left" style="width: 110px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #EDEDED; border-top: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;">Fecha Creaci<h:outputText value="#{msg.tilde_o}" />n</span>
				<span class="left" style="width: 170px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #EDEDED; border-top: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;">Usuario <h:outputText value="#{msg.tilde_u}" />ltima Modificaci<h:outputText value="#{msg.tilde_o}" />n</span>
				<span class="left" style="width: 170px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #EDEDED; border-top: 1px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;">Fecha <h:outputText value="#{msg.tilde_u}" />ltima Modificaci<h:outputText value="#{msg.tilde_o}" />n</span>
				</span>		
				<span class="left" >
				<span class="left" style="width: 110px; height: 15px; margin-left:25px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #ffffff; border-top: 0px solid #999999; border-bottom: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; color: #666666;"><h:outputText value="#{operdesmonteretController.operdesmonteret.usuarioCrea}" /></span>
				<span class="left" style="width: 110px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #ffffff; border-top: 0px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;"><h:outputText value="#{operdesmonteretController.operdesmonteret.fechaCrea}" /></span>
				<span class="left" style="width: 170px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #ffffff; border-top: 0px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;"><h:outputText value="#{operdesmonteretController.operdesmonteret.usuarioModifica}" /></span>
				<span class="left" style="width: 170px; height: 15px; margin-left:0px; padding-top:5px; padding-bottom:5px; padding-left:10px; padding-right:10px; background-color: #ffffff; border-top: 0px solid #999999; border-bottom: 1px solid #999999; border-left: 0px solid #999999; border-right: 1px solid #999999; color: #666666;"><h:outputText value="#{operdesmonteretController.operdesmonteret.fechaModifica}" /></span>
				</span>
		    </div>
		    <div class="clear"></div><br/>    
			<div>
			    <h:form id="cancelManageForm">
				<h:commandButton id="cancelManageButton"
				 styleClass="botonsmall" 
                 type="submit" 
                 value="Cancelar" 
                 ondblclick="return false;" 
                 action="#{operdesmonteretController.cancelOperDesmonteRet}" >
             	</h:commandButton>
				</h:form>
			</div>							    				
    </div>
	<div class="abajo-cuerpo"></div> 
	</div> <!-- Fin contenedor -->
	<div class="footer"></div>	
<script src="<%=contextRoot%>/js/jquery/lib/jquery-1.7.2.min.js"></script><!-- De ser 1ro -->
<script src="<%=contextRoot%>/js/script.js" type="text/javascript"></script><!-- De ser 2do -->
<script src="<%=contextRoot%>/js/jquery/lib/jquery.uniform.min.js"></script> <!-- formularios --> 
<script src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=contextRoot%>/js/jquery.maskedinput-1.3.js" type="text/javascript"></script> <!-- Quitar si no se usan fechas -->
<script src="<%=contextRoot%>/js/sisdep.js" type="text/javascript"></script> <!-- Quitar si no se usan funciones custom -->
<script type="text/javascript">
jQ(document).ready(function() {
	jQ("input, select, input:checkbox, input:radio, input:file").uniform();
	jQ("#manageOperDesmonteRetForm").validationEngine('attach');
	jQ("#manageOperDesmonteRetForm").bind("jqv.form.result", function(event, errorFound) {
        if(!errorFound) displayLoadingImage();
    });
  	jQ(".fechaRegistro").mask("99/99/9999");
});
</script>
<%@ include file="include/validationStatus.jsp" %>
</body>
</html>
</f:view>
